<?php
isset($_SESSION['id']) ? $_SESSION['id'] : die('ERROR: NO session'); 
?>
    <div id="container" style='border-top: 1px #009900 solid'>
    <?php
     $this->load->library('QUERY');
             
     // include_once(LIB_PATH . 'query.php');
      foreach($posts as $post)
          {
            $cols = array('name'=>'first_name," ",last_name','photo');
            $user = new QUERY(array('TABLE'=>'member','KEY'=>array('member_id'=>$post['member_id']),'COLS'=>$cols))
          
   ?>
            <div id='postContainer'>
                
                <div id='postHeader'>
                  <span>
                      <img src='<?=USER_THUMB.$user->fetch('photo')?>' class='smallPhoto'> 
                     <span class='spanAuthor'><?=$user->fetch('name')?></span>
                  </span>
                    <br />
                  <span class='spanTitle'><?=$post['title']?><span>
                </div>
                
                <div id='postBody'><?=$post['content']?></div>
                <div id='postFoot'>
                    <span><?=date('F m, Y g:i a',  strtotime($post['posted_on']))?></span> | 
                    <span id='spanComments' class='spanCommentsLink' onclick='displayComments("<?=$post['post_id']?>")'>Comments</span>
                </div>
            </div>      
 
           <div id='divComment<?=$post['post_id']?>' class='divComment'></div>
    <?php
         unset($user);
          }
          
    ?>
   </div>

 
<?php
 include_once(APPPATH.'includes/footer.php');
?>